﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using hse_2013_tetris;


namespace Tetris.Tests
{
    [TestClass]
    public class Tetris
    {
       
        [TestMethod]
        public void When_figure_is_not_null()
        {
            Figures f = new Figures();
            Assert.IsNotNull(f);            
        }
        [TestMethod]
        [ExpectedException(typeof(IndexOutOfRangeException))]
        public void Cannot_exist_figure()
        {
            Figures f = new Figures();           
            int[,] pix;
            f.fillpix(out pix, "...");      
        }
        [TestMethod]
        public void Metod_exists()
        {
            Figures f = new Figures();
            f.rotate();
        }
        [TestMethod]
        public void Check_matrix()
        {
             Figures figure = new Figures();
            bool a=false;
            for (int i = 0; i < 4; i++)
                for (int j = 0; j < 4; j++)
                {
                if (figure.pix[i, j] != 0)
                    a= true;
                }
            Assert.IsTrue(a);          
        }
        [TestMethod]
        public void Compare()
        {
            Figures figure = new Figures();
            int a = figure.y;
            int b = figure.x;
            Assert.AreNotEqual(a, b);
        }
    }
}
